package com.fzu.normalservice.service.impl;

import com.fzu.commonutil.entity.User;
import com.fzu.commonutil.params.DataResult;
import com.fzu.normalservice.service.*;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class DataServiceImpl implements DataService {
    private final UserService userService;
    private final DemandService demandService;
    private final CompanyService companyService;
    private final HousekeeperService housekeeperService;
    @Override
    public DataResult data(Integer companyId) {
        DataResult dataResult = new DataResult();
        dataResult = userService.userData(dataResult);
        dataResult = demandService.demandData(dataResult, companyId);
        dataResult = housekeeperService.housekeeperData(dataResult, companyId);
        dataResult.setCompanyCount(companyService.count(null));
        return dataResult;
    }
}
